package com.gg.registration.model.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gg.registration.model.base.BaseEntity;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * Patient
 * </p>
 *
 * @author qy
 */
@Data
@TableName("patient")
public class Patient extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	@TableField("user_id")
	private Long userId;

	@TableField("name")
	private String name;

	@TableField("certificates_type")
	private String certificatesType;

	@TableField("certificates_no")
	private String certificatesNo;

	@TableField("sex")
	private Integer sex;

	@JsonFormat(pattern = "yyyy-MM-dd")
	@TableField("birthdate")
	private Date birthdate;

	@TableField("phone")
	private String phone;

	@TableField("is_marry")
	private Integer isMarry;

	@TableField("province_code")
	private String provinceCode;

	@TableField("city_code")
	private String cityCode;

	@TableField("district_code")
	private String districtCode;

	@TableField("address")
	private String address;

	@TableField("contacts_name")
	private String contactsName;

	@TableField("contacts_certificates_type")
	private String contactsCertificatesType;

	@TableField("contacts_certificates_no")
	private String contactsCertificatesNo;

	@TableField("contacts_phone")
	private String contactsPhone;

	@TableField("is_insure")
	private Integer isInsure;

	@TableField("card_no")
	private String cardNo;

	@TableField("status")
	private String status;


	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCertificatesType() {
		return certificatesType;
	}

	public void setCertificatesType(String certificatesType) {
		this.certificatesType = certificatesType;
	}

	public String getCertificatesNo() {
		return certificatesNo;
	}

	public void setCertificatesNo(String certificatesNo) {
		this.certificatesNo = certificatesNo;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Date getBirthdate() {
		return birthdate;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getIsMarry() {
		return isMarry;
	}

	public void setIsMarry(Integer isMarry) {
		this.isMarry = isMarry;
	}

	public String getProvinceCode() {
		return provinceCode;
	}

	public void setProvinceCode(String provinceCode) {
		this.provinceCode = provinceCode;
	}

	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}

	public String getDistrictCode() {
		return districtCode;
	}

	public void setDistrictCode(String districtCode) {
		this.districtCode = districtCode;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getContactsName() {
		return contactsName;
	}

	public void setContactsName(String contactsName) {
		this.contactsName = contactsName;
	}

	public String getContactsCertificatesType() {
		return contactsCertificatesType;
	}

	public void setContactsCertificatesType(String contactsCertificatesType) {
		this.contactsCertificatesType = contactsCertificatesType;
	}

	public String getContactsCertificatesNo() {
		return contactsCertificatesNo;
	}

	public void setContactsCertificatesNo(String contactsCertificatesNo) {
		this.contactsCertificatesNo = contactsCertificatesNo;
	}

	public String getContactsPhone() {
		return contactsPhone;
	}

	public void setContactsPhone(String contactsPhone) {
		this.contactsPhone = contactsPhone;
	}

	public Integer getIsInsure() {
		return isInsure;
	}

	public void setIsInsure(Integer isInsure) {
		this.isInsure = isInsure;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		Patient patient = (Patient) o;
		return Objects.equals(userId, patient.userId) &&
				Objects.equals(name, patient.name) &&
				Objects.equals(certificatesType, patient.certificatesType) &&
				Objects.equals(certificatesNo, patient.certificatesNo) &&
				Objects.equals(sex, patient.sex) &&
				Objects.equals(birthdate, patient.birthdate) &&
				Objects.equals(phone, patient.phone) &&
				Objects.equals(isMarry, patient.isMarry) &&
				Objects.equals(provinceCode, patient.provinceCode) &&
				Objects.equals(cityCode, patient.cityCode) &&
				Objects.equals(districtCode, patient.districtCode) &&
				Objects.equals(address, patient.address) &&
				Objects.equals(contactsName, patient.contactsName) &&
				Objects.equals(contactsCertificatesType, patient.contactsCertificatesType) &&
				Objects.equals(contactsCertificatesNo, patient.contactsCertificatesNo) &&
				Objects.equals(contactsPhone, patient.contactsPhone) &&
				Objects.equals(isInsure, patient.isInsure) &&
				Objects.equals(cardNo, patient.cardNo) &&
				Objects.equals(status, patient.status);
	}

	@Override
	public int hashCode() {
		return Objects.hash(userId, name, certificatesType, certificatesNo, sex, birthdate, phone, isMarry, provinceCode, cityCode, districtCode, address, contactsName, contactsCertificatesType, contactsCertificatesNo, contactsPhone, isInsure, cardNo, status);
	}

	@Override
	public String toString() {
		return "Patient{" +
				"userId=" + userId +
				", name='" + name + '\'' +
				", certificatesType='" + certificatesType + '\'' +
				", certificatesNo='" + certificatesNo + '\'' +
				", sex=" + sex +
				", birthdate=" + birthdate +
				", phone='" + phone + '\'' +
				", isMarry=" + isMarry +
				", provinceCode='" + provinceCode + '\'' +
				", cityCode='" + cityCode + '\'' +
				", districtCode='" + districtCode + '\'' +
				", address='" + address + '\'' +
				", contactsName='" + contactsName + '\'' +
				", contactsCertificatesType='" + contactsCertificatesType + '\'' +
				", contactsCertificatesNo='" + contactsCertificatesNo + '\'' +
				", contactsPhone='" + contactsPhone + '\'' +
				", isInsure=" + isInsure +
				", cardNo='" + cardNo + '\'' +
				", status='" + status + '\'' +
				'}';
	}
}

